﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using d3PrtDgn.Common.Utils.ShootSeg;
using d3PrtDgn.Common.Utils;
using d3PrtDgn.Common.Utils.Mail;

namespace d3PrtDgn.Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string splitchar = " ";
            string key = "我今天特别的累";

            Segment seg = new Segment();

            seg.DicPath = @"C:\TSPRO_元\WORK\Web\d3PrtDgn\d3PrtDgn.Test\_data\ShootSeg\sDict.dic";
            seg.NoisePath = @"C:\TSPRO_元\WORK\Web\d3PrtDgn\d3PrtDgn.Test\_data\ShootSeg\sNoise.dic";
            seg.NumberPath = @"C:\TSPRO_元\WORK\Web\d3PrtDgn\d3PrtDgn.Test\_data\ShootSeg\sNumber.dic";
            seg.WordPath = @"C:\TSPRO_元\WORK\Web\d3PrtDgn\d3PrtDgn.Test\_data\ShootSeg\sPrefix.dic";
            seg.PrefixPath = @"C:\TSPRO_元\WORK\Web\d3PrtDgn\d3PrtDgn.Test\_data\ShootSeg\sWord.dic";

            seg.InitWordDics();
            seg.EnablePrefix = true;
            seg.Separator = splitchar;
            string aaa =  seg.SegmentText(key, false).Trim();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            string url = @"https://www.google.co.jp/";
            string aaa = HttpHelp.Get_Http(url);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            
            MailMessage message = new MailMessage();
            message.MaxRecipientNum = 80;//最大收件人
            message.From = "jianglanshui@gmail.com";
            message.FromName = "laojiang";
            message.AddRecipients("jiangst@7plus.co.jp");


            message.Subject = "XXX is dsb";
            message.BodyFormat = MailFormat.HTML;
            message.Priority = MailPriority.Normal;
            message.Body = "are you OK?";

            string MailSmtpHost = "smtp.gmail.com";
            int MailSmtpPort = 587;
            SmtpClient smtp = new SmtpClient(MailSmtpHost, MailSmtpPort);
            bool aa = smtp.Send(message, "jianglanshui@gmail.com", "jiang123");
              
        }
    }
}
